package 对象比较器;

import java.util.Arrays;
import java.util.Comparator;

public class Data {
    public static void main(String[] args) {
        Dog[] dogs = {
                new Dog("张三", 24),
                new Dog("张三", 22),
                new Dog("张三", 32)
        };
        Arrays.sort(dogs,new DogComparator());
        System.out.println(Arrays.toString(dogs));
    }
}
